package com.example.crm.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.crm.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zz
 * @since 2024-05-28
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    List<User> getAllUsers( @Param("usrName") String usrName,@Param("roleId") Long roleId);
    User getUserInfoById(@Param("usrId") Long uerId);

    User getUserByNameAndPwd( @Param("usrName") String usrName, @Param("usrPassword") String usrPassword);

    User findByName(@Param("usrName")String usrName);
    @Update("update sys_user set usr_isDelete = 1 where usr_id = #{usrId}")
    boolean del(@Param("usrId")Long usrId);
    Page<User> selectPage(@Param("usrName") String usrName, @Param("roleId") Integer roleId,Page<User> page);
}
